home *** CD-ROM | disk | FTP | other *** search
- on InitData
- global gFullCuttings, gMaxLines, gCurIndex, gName, gMakerName, gWorld, gSeenMaps, mpath, gHeadlocH, gNameLoch, gNameLocv, gMakerNum, gQTpath, gSoundpath, gTotalChapters, gMaxNuggets, gnuggets, gWhichNugget, gNuggetList, gNuggetOn, gNameCastnum, gInAMap, gNuggetDelay, gNuggetTime, gTrapStart
- updateStage()
- set gInAMap to 0
- set gTrapStart to 0
- sound stop 1
- sound stop 2
- set the keyDownScript to "CheckPrint"
- InitDataGlobals()
- set gMakerNum to value(gMakerNum)
- set gMakerName to line gMakerNum of field "Makernumlist"
- set name to gMakerName
- set the text of field "ArticleNumber" to string(gMakerNum)
- set gSeenMaps to 0
- startTimer()
- set gMaxLines to 18
- set the itemDelimiter to "#"
- set gMaxNuggets to the number of items in gnuggets
- set the itemDelimiter to ","
- set gWhichNugget to random(gMaxNuggets)
- set gNuggetList to [gWhichNugget]
- set gNuggetOn to 0
- set gNuggetDelay to 15 * 60
- set gNuggetTime to the ticks
- put "loading script file and parsing it took: " && the timer && "ticks"
- puppetSprite(10, 1)
- set the castNum of sprite 10 to the number of cast (gMakerNum & "-head")
- if gWorld = "Power" then
- set the locV of sprite 10 to 101
- set the locH of sprite 10 to 42
- set gHeadlocH to 42
- else
- if gWorld = "Senses" then
- set the locV of sprite 10 to 39
- set the locH of sprite 10 to 38
- set gHeadlocH to 38
- else
- if gWorld = "mind" then
- set the locV of sprite 10 to 53
- set the locH of sprite 10 to 41
- set gHeadlocH to 41
- else
- if gWorld = "discover" then
- set the locH of sprite 10 to 35
- set the locV of sprite 10 to 85
- set gHeadlocH to 35
- else
- if gWorld = "body" then
- set the locV of sprite 10 to 61
- set the locH of sprite 10 to 47
- set gHeadlocH to 47
- else
- set the locV of sprite 10 to 53
- set the locH of sprite 10 to 42
- set gHeadlocH to 42
- end if
- end if
- end if
- end if
- end if
- puppetSprite(4, 1)
- set gNameCastnum to the number of cast (gMakerNum & ".name")
- set the castNum of sprite 4 to gNameCastnum
- if gWorld = "Power" then
- set the locH of sprite 4 to 151
- set the locV of sprite 4 to 24
- else
- if gWorld = "Design" then
- set the locH of sprite 4 to 137
- set the locV of sprite 4 to 96
- set gNameLoch to 137
- set gNameLocv to 96
- else
- if gWorld = "Mind" then
- set the locH of sprite 4 to 244
- set the locV of sprite 4 to 68
- else
- if gWorld = "discover" then
- if gNameCastnum > 0 then
- set the locH of sprite 4 to the width of cast gNameCastnum / 2
- end if
- set the locV of sprite 4 to 20
- else
- if gWorld = "body" then
- set the locH of sprite 4 to 360
- set the locV of sprite 4 to 11
- else
- if gWorld = "Senses" then
- set the locH of sprite 4 to 172
- set the locV of sprite 4 to 19
- set gNameLoch to 172
- set gNameLocv to 19
- end if
- end if
- end if
- end if
- end if
- end if
- updateStage()
- if the machineType = 256 then
- openXLib(the pathName & "fileio.dll")
- end if
- set cuname to "CU" & gMakerNum
- set obj to FileIO(mnew, "read", mpath & cuname & ".TXT")
- if objectp(obj) then
- set gFullCuttings to obj(mReadFile)
- obj(mdispose)
- delete line the number of lines in gFullCuttings of gFullCuttings
- else
- alert("Error opening " && cuname & ".TXT")
- set forcd to 0
- if forcd = 1 then
- ReturnToWorld()
- else
- abort()
- go(2)
- end if
- end if
- if the machineType = 256 then
- closeXLib(the pathName & "fileio.dll")
- end if
- set cuttingindexcast to the number of cast ("CuttingIndex" & gWorld)
- set tmp to Bsearch(gMakerName, cuttingindexcast)
- set gCurIndex to line tmp of field cuttingindexcast
- if the machineType < 256 then
- openXLib(the pathName & "FixPalette")
- set obj to FixPalette(mnew, 0, 0, 640, 480)
- obj(mPatchIt)
- obj(mdispose)
- closeXLib(the pathName & "FixPalette")
- end if
- set num to count(gChapters)
- set the text of field "chaptertitles" to "INTRODUCTION"
- repeat with i = 2 to num
- put getAt(gChapters, i) into line i of field "chaptertitles"
- end repeat
- set the text of field "CurrentArticle" to " "
- set the text of field "CurrentChapter" to " "
- set the visible of sprite 35 to 0
- set the visible of sprite 36 to 0
- set the visible of sprite 19 to 0
- set the visible of sprite 20 to 0
- NavButtonWindow()
- UnBlackScreen()
- sound playFile 1, gSoundpath & "S" & gMakerNum
- put "initializing the database took:" && the timer && "ticks"
- end
-
- on GoChapter num
- global gChapters, gTitles, gArticles, gDates, gCaptions, gCurChap, gCurArticle
- set numchaps to count(gChapters)
- put "gochap " && num
- if num > (numchaps + 1) then
- exit
- end if
- if num < 1 then
- exit
- end if
- unpuppet("4,10")
- if num = (numchaps + 1) then
- else
- set gCurChap to num
- set gCurArticle to 1
- GoArticle()
- end if
- end
-
- on GoFlyingFacts
- global gnuggets, gWorld, gNameLoch, gNameLocv, gNameCastnum, gHeadlocH, gMakerNum, gFlyingFacts, gArticlePage, gTextPages, gMaxLines
- set namesprite to 4
- set headsprite to 10
- if (gWorld = "design") and (the frameLabel = "cutting") then
- set the locH of sprite namesprite to 1000
- set the castNum of sprite namesprite to gNameCastnum
- end if
- set the locH of sprite headsprite to gHeadlocH
- set gFlyingFacts to " "
- set the itemDelimiter to "@"
- set tmpnugget to item gMakerNum of field ("makernugget" & (gMakerNum / 20) + 1)
- set the itemDelimiter to "#"
- set num to the number of items in tmpnugget
- repeat with i = 1 to num
- put item i of tmpnugget & RETURN after gFlyingFacts
- end repeat
- delete char 1 of gFlyingFacts
- delete line 1 of gFlyingFacts
- if the last line in gFlyingFacts = EMPTY then
- delete char -30003 of gFlyingFacts
- end if
- set the itemDelimiter to ","
- if gWorld = "Power" then
- set gMaxLines to 19
- else
- if gWorld = "Senses" then
- set gMaxLines to 25
- else
- if gWorld = "body" then
- set gMaxLines to 22
- else
- set gMaxLines to 20
- end if
- end if
- end if
- set the text of field "flyingfacts" to line 1 to gMaxLines of gFlyingFacts
- set numlines to the number of lines in gFlyingFacts
- set tmppages to numlines / gMaxLines
- if (tmppages * gMaxLines) = numlines then
- set gTextPages to tmppages
- else
- set gTextPages to tmppages + 1
- end if
- set gArticlePage to 1
- go("facts")
- if (gWorld = "Senses") or (gWorld = "Design") then
- set the locH of sprite namesprite to gNameLoch
- set the locV of sprite namesprite to gNameLocv
- end if
- set the text of field "currentchapter" to "FLYING FACTS"
- set the text of field "currentarticle" to "1/1"
- set the visible of sprite 35 to 0
- set the visible of sprite 36 to 0
- set the visible of sprite 19 to 0
- if the number of lines in gFlyingFacts > gMaxLines then
- set the visible of sprite 20 to 1
- else
- set the visible of sprite 20 to 0
- end if
- end
-
- on NameToNum name
- set num to Bsearch(name, "MakerList")
- return value(item 2 of line num of field "MakerList")
- end
-
- on InitDataGlobals
- global gdelim, gWorld, mpath, gMakerName, gMakerNum, gSoundpath, gQTpath, gDrive, gQTbuttons, gMakersPath, gQTAnimpath, gClickSndCast
- set gClickSndCast to the number of cast "click"
- put the number of cast "qtplay" into item 1 of gQTbuttons
- put the number of cast "qtstop" into item 2 of gQTbuttons
- if the machineType <> 256 then
- set gdelim to ":"
- set the itemDelimiter to gdelim
- set gDrive to item 1 of the pathName
- set the itemDelimiter to ","
- else
- set gdelim to "\"
- set the itemDelimiter to gdelim
- set gDrive to item 1 of the pathName
- set the itemDelimiter to ","
- end if
- set the itemDelimiter to "."
- set gWorld to item 1 of the movieName
- set the itemDelimiter to ","
- set mpath to the pathName & gWorld & gdelim
- set gSoundpath to gDrive & gdelim & "SOUNDDB" & gdelim
- set gQTpath to gDrive & gdelim & "QTDB" & gdelim
- set gQTAnimpath to gDrive & gdelim & "QTANIM" & gdelim
- set gMakersPath to gDrive & gdelim & "MAKERS" & gdelim
- set gMakerName to word 1 of line value(gMakerNum) of field "MakerNumList"
- end
-
- on AdjustText txt, maxlines
- set numlines to the number of lines in txt
- set numpages to numlines / maxlines
- if (numpages * numlines) < numlines then
- set numpages to numpages + 1
- end if
- repeat with i = 1 to numpages
- if line ((i - 1) * maxlines) + 1 of txt = RETURN then
- delete line ((i - 1) * maxlines) + 1 of txt
- end if
- if line (i * maxlines) - 1 of txt = RETURN then
- set tmp to line i * maxlines to numlines of txt
- delete line i * maxlines to numlines of txt
- put RETURN into line i * maxlines of txt
- put RETURN & tmp after txt
- end if
- end repeat
- return txt
- end
-
- on FillText txt, fnt, sz, width
- return txt
- end
-
- on MoveArticle dir
- global gCurArticle, gArticles, gCurChap, gMakerNum
- set num to count(getAt(gArticles, gCurChap))
- if dir = "prev" then
- if gCurArticle > 1 then
- set gCurArticle to gCurArticle - 1
- else
- set gCurArticle to num
- end if
- if (gMakerNum = 10) and (gCurChap = 2) and (gCurArticle = 3) then
- set gCurArticle to 2
- end if
- if (gMakerNum = 39) and (gCurChap = 2) and (gCurArticle = 2) then
- set gCurArticle to 1
- end if
- else
- if gCurArticle < num then
- set gCurArticle to gCurArticle + 1
- else
- set gCurArticle to 1
- end if
- if (gMakerNum = 10) and (gCurChap = 2) and (gCurArticle = 3) then
- set gCurArticle to 4
- end if
- if (gMakerNum = 39) and (gCurChap = 2) and (gCurArticle = 2) then
- set gCurArticle to 3
- end if
- end if
- NavButtonUpdate()
- GoArticle()
- end
-
- on ScrollPage dir
- global gArticlePage, gCurCutting, gFormattedText, gTextPages, gMaxLines, gWorld, gCurChap, gPicLoch, gFlyingFacts, gMakerNum
- set picsprite to 3
- set cuttingsprite to 6
- if (the frameLabel contains "partwork") and (gArticlePage = 1) then
- set gPicLoch to the locH of sprite picsprite
- end if
- if dir = "back" then
- if gArticlePage > 1 then
- set gArticlePage to gArticlePage - 1
- else
- set gArticlePage to gTextPages
- end if
- else
- if dir = "next" then
- if gArticlePage < gTextPages then
- set gArticlePage to gArticlePage + 1
- else
- set gArticlePage to 1
- end if
- end if
- end if
- if the frameLabel contains "cutting" then
- set the text of field "cutting" to line ((gArticlePage - 1) * gMaxLines) + 1 to gArticlePage * gMaxLines of gFormattedText
- else
- if the frameLabel = "facts" then
- set the text of field "flyingfacts" to line ((gArticlePage - 1) * gMaxLines) + 1 to gArticlePage * gMaxLines of gFlyingFacts
- else
- if the frameLabel contains "partwork" then
- if (gArticlePage = 1) and (gWorld = "Power") and (gCurChap = 1) then
- set the text of field "partwork" to " "
- if gMakerNum = 119 then
- go("partwork.MAT")
- else
- go("partwork")
- end if
- puppetSprite(cuttingsprite, 1)
- set cuttingloch to the locH of sprite cuttingsprite
- set the locH of sprite cuttingsprite to 1000
- updateStage()
- set the locH of sprite picsprite to gPicLoch
- set the text of field "partwork" to line ((gArticlePage - 1) * gMaxLines) + 1 to gArticlePage * gMaxLines of gFormattedText
- set the locH of sprite cuttingsprite to cuttingloch
- puppetSprite(cuttingsprite, 0)
- updateStage()
- else
- if gCurChap > 1 then
- if gMakerNum = 119 then
- go("innerpartwork.MAT")
- else
- go("innerpartwork")
- end if
- set the text of field "partwork2" to line ((gArticlePage - 1) * gMaxLines) + 1 to gArticlePage * gMaxLines of gFormattedText
- else
- set the locH of sprite picsprite to 1000
- if gMakerNum = 119 then
- go("partwork2.MAT")
- else
- go("partwork2")
- end if
- set the text of field "partwork2" to line ((gArticlePage - 1) * gMaxLines) + 1 to gArticlePage * gMaxLines of gFormattedText
- end if
- end if
- end if
- end if
- end if
- set forwardbutton to 20
- set backbutton to 19
- if gArticlePage > 1 then
- set the visible of sprite backbutton to 1
- else
- set the visible of sprite backbutton to 0
- end if
- if gArticlePage = gTextPages then
- set the visible of sprite forwardbutton to 0
- else
- set the visible of sprite forwardbutton to 1
- end if
- EndTrapMouse()
- end
-
- on SetVolume
- global gWorld
- set volsprite to 37
- set level to the soundLevel
- puppetSprite(volsprite, 1)
- if the frameLabel = "qt" then
- set the castNum of sprite volsprite to the number of cast ("vol" & level)
- end if
- end
-
- on VolumeDrag dir
- global gWorld
- set me to the clickOn
- if not (the puppet of sprite me) then
- puppetSprite(me, 1)
- end if
- set oldlevel to the soundLevel
- if the paramCount = 0 then
- if gWorld = "mind" then
- set bottom to 35
- else
- set bottom to 25
- end if
- set inc to (the height of sprite me - bottom) / 7
- repeat while the mouseDown
- set mv to the mouseV
- set v to mv - the top of sprite me
- set level to 8 - (v / inc)
- if level > 7 then
- set level to 7
- else
- if level < 0 then
- set level to 0
- end if
- end if
- if oldlevel <> level then
- set the soundLevel to level
- set oldlevel to level
- end if
- updateStage()
- if (gWorld = "body") and (the frameLabel = "cutting") then
- set the castNum of sprite me to the number of cast ("volb" & level)
- next repeat
- end if
- set the castNum of sprite me to the number of cast ("vol" & level)
- end repeat
- else
- if dir = "horizontal" then
- set bottom to 25
- set inc to (the width of sprite me - bottom) / 7
- repeat while the mouseDown
- set mh to the mouseH
- set h to the right of sprite me - mh
- set level to 8 - (h / inc)
- if level > 7 then
- set level to 7
- else
- if level < 0 then
- set level to 0
- end if
- end if
- if oldlevel <> level then
- set the soundLevel to level
- set oldlevel to level
- end if
- updateStage()
- if gWorld = "body" then
- set the castNum of sprite me to the number of cast ("volb" & level)
- next repeat
- end if
- set the castNum of sprite me to the number of cast ("vol" & level)
- end repeat
- end if
- end if
- end
-